<?php  
header("content-type:text/html;charset=utf-8");
include_once("Db.php"); //引入Db类文件

$db = new Db(); //实例化Db类
$list = $db->select("client"); //调用类内select()方法
?>
<meta charset="UTF-8">
<title>列表页</title>
<style>
	table{background-color: skyblue;width: 100%;}
	tr{height: 50px;}
	/* 隔行变色 */
	tr:nth-child(even){background-color: pink;}
	tr:nth-child(odd){background-color: #fff;}
	tr:nth-child(1){background-color: skyblue;text-align: center;}
	p{margin-left: 30px;}
	p button{font-size: 20px; background-color: #fff;padding: 5px 8px;color: #09f;}
</style>
<p><a href="add.html"><button type="button">添加</button></a></p>
<center>
<table>
	<tr>
		<td width="5%"><input type="checkbox"></td>
		<td width="15%">编号</td>
		<td width="15%">客户名称</td>
		<td width="13%">负责人</td>
		<td width="15%">公司电话</td>
		<td width="20%">描述</td>
		<td width="10%">状态</td>
		<td width="7%">操作</td>
	</tr>
	<?php foreach ($list as $key => $value): ?>
		<tr>
			<td style="text-align: center"><input type="checkbox"></td>
			<td><?php echo $value['bh'] ?></td>
			<td><?php echo $value['name'] ?></td>
			<td><?php echo $value['principal'] ?></td>
			<td><?php echo $value['tel'] ?></td>
			<td><?php echo $value['dess'] ?></td>
			<td>未分配</td>
			<td style="text-align: center">
				<a href="del.php?id=<?php echo $value['id'] ?>">
					<button type="button">删除</button>
				</a>
			</td>
		</tr>
	<?php endforeach ?>
</table>
</center>